{extend name="admin@index_layout"/}
{block name="main"}
<div class="layui-card">
    <div class="layui-card-header">提现列表</div>
    <div class="layui-card-body">
        <table class="layui-hide" id="currentTable" lay-filter="currentTable"></table>
    </div>
</div>
<script type="text/html" id="barTool">
    {{# if(d.status==0){ }}
    <a class="layui-btn layui-btn-xs" data-open='{:url("edit")}?id={{ d.id }}' data-title="审核">审核</a>
    {{# } }}

    {{# if(d.status==1&&d.is_kuan==0){ }}
    <a href="javascript:;" onclick="wk.confirm('{{d.id}}','{:url('ckuan')}','确认转账吗？')" class="layui-btn layui-btn-xs layui-btn-normal" title="确认转账">确认转账</a>
    {{# } }}


    {{# if(d.status==1){ }}
    <a class="layui-btn layui-btn-xs layui-btn-warm" data-open='{:url("detail")}?id={{ d.id }}'
       data-title="查看详情">查看详情</a>
    {{# } }}
</script>
{/block}
{block name="script"}
<script>
    layui.use(['yznTable', 'table'], function () {
        var table = layui.yznTable;
        var init = {
            table_elem: '#currentTable',
            table_render_id: 'currentTable',
            add_url: "{:url('add')}",
            edit_url: "{:url('edit')}",
            delete_url: "{:url('del')}",
        };
        table.render({
            elem: '#currentTable',
            autoWidth: true,
            toolbar: ['refresh',],
            url: '{:url("index")}?status={$status}',
            init: init,
            cols: [
                [
                    // {type: 'checkbox', fixed: 'left'},
                    {field: 'id', align: 'center', width: 50, title: 'ID'},
                    {field: 'nickname', align: 'center', width: '10%', title: '用户名称'},
                    // {field: 'finance_people', align: 'center', width: '10%', title: '财务联系人', search: false},
                    // {field: 'finance_phone', align: 'center', width: '10%', title: '财务联系电话', search: false},
                    {field: 'money', align: 'center', width: '10%', title: '提现金额', search: false},
                    // {field: 'shou_money', align: 'center', width: '10%', title: '手续费', search: false},
                    // {field: 'true_money', align: 'center', width: '10%', title: '实际到账', search: false},
                    {field: 'tixian_bank', align: 'center', width: '10%', title: '银行', search: false},
                    {field: 'tixian_name', align: 'center', width: '10%', title: '提现人', search: false},
                    {field: 'tixian_account', align: 'center', width: '16%', title: '银行账号', search: false},
                    //1陪诊 导诊服务 2司机服务 3分销订单收入 4陪诊提现 5司机提现 6
                    // {field: 'type', align: 'center', width: '10%', title: '提现类型',templet: function (d) {
                    //         if (d.type == 3) {
                    //             return '<span style="color: black">陪诊护士提现</span>';
                    //         } else if (d.type == 4){
                    //             return '<span style="color: #00B7EE">分销提现</span>';
                    //         }else {
                    //             return '<span style="color: red">其他</span>';
                    //         }
                    //     },selectList: {3: '陪诊护士提现', 4: '分销提现'}
                    //  },
                    // {field: 'tixian_type', align: 'center', width: '10%', title: '账号类型',templet: function (d) {
                    //         if (d.tixian_type == 1) {
                    //             return '<span style="color: black">银行</span>';
                    //         } else if (d.tixian_type == 2){
                    //             return '<span style="color: #00B7EE">支付宝</span>';
                    //         }else if (d.tixian_type == 3){
                    //             return '<span style="color: #00B83F">微信</span>';
                    //         }else {
                    //             return '<span style="color: red">其他</span>';
                    //         }
                    //     },selectList: {1: '银行', 2: '支付宝', 3: '微信'}},
                    // {
                    //     field: 'true_money', align: 'center', width: '10%', title: '实际到账金额', templet: function (d) {
                    //
                    //         return  '<span style="color: green;font-weight: 800">'+d.true_money+'</span>';
                    //
                    //     }, search: false
                    // },
                    // {field: 'commission', align: 'center', width: '10%', title: '提现佣金百分比', search: false},
                    {
                        field: 'status', align: 'center', width: '10%', title: '审核状态', templet: function (d) {
                            if (d.status == 1) {
                                return '<span style="color: green">审核通过</span>';
                            } else {
                                return '<span style="color: red">待审核</span>';
                            }
                        }, selectList: {0: '待审核', 1: '审核通过'}
                    },
                    {
                        field: 'is_kuan', align: "center", width: '8%', title: '转账状态', templet: function (d) {
                            if (d.is_kuan == 0) {
                                return '<span style="color: red">未转账</span>';
                            } else if (d.is_kuan == 1) {
                                return '<span style="color: green">转账完成</span>';
                            } else {
                                return '<span>未知</span>';
                            }
                        }, selectList: {0: '未转账', 1: '转账完成'}
                    },
                    {field: 'create_time', align: 'center', width: '15%', title: '提现时间', search: 'range'},
                    {field: 'status_time', align: 'center', width: '15%', title: '审核通过时间', search: 'range'},
                    {field: 'kuan_time', align: 'center', width: '15%', title: '转账时间', search: 'range'},
                    {fixed: 'right', align: 'center', width: '15%', title: '操作', toolbar: '#barTool'}//delete'
                ]
            ],
            page: {}
        });
        table.bindevent();
        selectElement2 = document.getElementById('searchFieldset_currentTable');
        selectElement2.classList.remove("layui-hide");
        var element = document.getElementById('layui-input-search');
        element.parentNode.removeChild(element);
    });
</script>
{/block}